Add the "memoize" attribute to the node macro#4065
Merged
Conversation
83351c0 to
c3a4796
Compare
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a memoize attribute to the node macro, enabling automatic caching for specific nodes. The changes include updating the NodeMetadata struct, enhancing the macro's parsing and code generation to handle the new attribute, and modifying the preprocessor to insert a Memo node into the subnetwork when memoization is enabled. Additionally, the sample_polyline node has been updated to utilize this feature. I have no feedback to provide.
Contributor
There was a problem hiding this comment.
1 issue found across 6 files
Confidence score: 3/5
- There is a concrete medium-severity risk in
node-graph/preprocessor/src/lib.rs: whengenerated_nodes == 0, thememoizeflag is ignored, so expected Memo nodes are not appended. - Because this affects memoized nodes without conversion wrappers, behavior can regress in real graph execution paths, which makes this more than a minor housekeeping issue.
- Given the high confidence (9/10) and clear functional impact, this looks like some merge risk rather than a merge blocker.
- Pay close attention to
node-graph/preprocessor/src/lib.rs- ensure Memo node insertion still occurs for memoized nodes even when no conversion nodes are generated.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="node-graph/preprocessor/src/lib.rs">
<violation number="1" location="node-graph/preprocessor/src/lib.rs:131">
P2: `memoize` is ignored when `generated_nodes == 0`, so memoized nodes without conversion wrappers never get the Memo node appended.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Keavon
approved these changes
Apr 28, 2026
Keavon
pushed a commit
that referenced
this pull request
Apr 29, 2026
* Add memoization attribute to node macro * Fix memoization insertion for networks without conversion nodes
oluseyi
pushed a commit
to oluseyi/Graphite
that referenced
this pull request
Apr 29, 2026
* Add memoization attribute to node macro * Fix memoization insertion for networks without conversion nodes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.